﻿using Volo.Abp.Modularity;
using Volo.Abp.OpenIddict.ExtensionGrantTypes;
using WeChat.CMS.Controllers;
using static WeChat.CMS.Controllers.TokenController;

namespace WeChat.CMS
{
    public static  class VerifyGrantValidatorExtensions
    {
        public static OpenIddictServerBuilder AllowVerifyFlow(this OpenIddictServerBuilder builder)
        {
            return builder.AllowCustomFlow(ExtensionGrantConsts.VertifyCode);
        }

        public static IServiceCollection SetVerifyOptions(this ServiceConfigurationContext context)
        {
            return context.Services.Configure<AbpOpenIddictExtensionGrantsOptions>(optioons =>
            {
                optioons.Grants.Add(ExtensionGrantConsts.VertifyCode, new TokenController());
            });
        }

    }
}
